﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;

namespace theRift
{
    public class LightManager
    {
        // Global ambient scene color
        protected Vector3 ambientLightColor;

        protected SortedList<string, Light> lights;

        public Vector3 AmbientLightColor
        {
            get { return ambientLightColor; }
            set { ambientLightColor = value; }
        }

        public Light this[int index]
        {
            get { return lights.Values[index]; }
        }

        public Light this[string id]
        {
            get { return lights[id]; }
        }

        public int Count
        {
            get { return lights.Count; }
        }

        public LightManager()
            : this(Vector3.Zero)
        {
        }

        public LightManager(Vector3 ambientLightColor)
        {
            this.ambientLightColor = ambientLightColor;
            lights = new SortedList<string, Light>();
        }

        public void Clear()
        {
            lights.Clear();
        }

        public void Add(string id, Light light)
        {
            lights.Add(id, light);
        }

        public void Remove(string id)
        {
            lights.Remove(id);
        }
    }
}
